#include <stdio.h>
#include <assert.h>

unsigned rotate_left(unsigned x, int n){
    int w = sizeof(unsigned) << 3;

    return (x << n) | (x >> (w - n));
}


int main(){

    assert(rotate_left(0x12345678, 4) == 0x23456781);
    assert(rotate_left(0x12345678, 0) == 0x12345678);
    assert(rotate_left(0x12345678, 32) == 0x12345678);

    return 0;
}
